package com.DeliveryProgram.www.util;

import java.util.Scanner;

/**解决从屏幕获取用户选择的重复操作*/
public class Scanners {

    public static int getChoice(){
        int tep;
        Scanner sc=new Scanner(System.in);
        tep=sc.nextInt();
        return tep;

    }

    /**获取字符串*/
    public static String getScanner(){
        String str=null;
        while(str==null){
        Scanner sc=new Scanner(System.in);
        str=sc.next();
        if(str==null){
            System.out.println("--------输入不可为空-----");
        }
        }
        return str;
    }

    /**让系统短暂的停止*/
    public static void pause(){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入任意键后回车继续");
        sc.next();
    }

    /**获取小数*/
    public static double getDouble(){
        Scanner sc=new Scanner(System.in);

        return sc.nextDouble();
    }

}
